package com.jackson.service.Impl;

/*
 * Author: JacksonCoder
 * FileName: UserService
 * Version: 1.0.0
 */

import com.jackson.dao.AccountUser;
import com.jackson.domain.Account;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("UserService")
public class AccountService implements com.jackson.service.AccountService {

    @Autowired
    private AccountUser user;

    @Override
    public List<Account> findAll() {
        System.out.println("用户正在查询...");
        return user.findAll();
    }

    @Override
    public Account findById(Integer id) {
        System.out.println("用户查询中...");
        return user.findById(id);
    }

    @Override
    public void save(Account account) {
        user.save(account);
        System.out.println("用户添加成功...");
    }

    @Override
    public void update(Account account) {
        user.update(account);
        System.out.println("用户更新成功...");
    }

    @Override
    public void delete(Integer id) {
        user.delete(id);
        System.out.println("用户删除成功...");
    }
}
